package com.tang.mq;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;



@SpringBootApplication
@EnableBinding({Sink.class })
public class SPMCConsumerApplication {

    @Value("${server.port}")
    private int port;

    public static void main(String[] args) {
        SpringApplication.run(SPMCConsumerApplication.class, args);
        System.out.println("应用启动成功");
    }

    @StreamListener("input")
    public void receiveInput1(String receiveMsg) {
        System.out.println(port+":input1 receive: " + receiveMsg);
    }
}